package com.example.ry.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.example.ry.bean.Menu;
import com.example.ry.bean.ParamsData;
import com.example.ry.bean.User;
import com.example.ry.dao.impl.BaseDaoImpl;

@Service("userService")
public class UserService {

	@Resource(name="baseDao")
	private BaseDaoImpl dao;
	
	public User selectUserByUsername(ParamsData pd){
		return (User) dao.findOne("UserMapper.selectUserByUsername", pd);
	}
	
	public User selectUserRoleByUsername(ParamsData pd) {
		return (User) dao.findOne("UserMapper.selectUserRoleByUsername", pd);
	}
	
	public List<Menu> selectMenuByUsername(ParamsData pd){
		return dao.findAll("UserMapper.selectMenuByUsername", pd);
	}
}
